package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntity
import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.springframework.format.annotation.DateTimeFormat
import java.util.*
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

/**
 * @author Fei
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "su_my_report")
@TableName("su_my_report")
@ApiModel(value = "我的上报")
data class MyReport(

        @ApiModelProperty("上报类型 1.事故隐患 2.举报 3.安全建议 4.提醒")
        var type: Int? = null,

        @ApiModelProperty("安全顾问服务的企业id")
        var enterpriseUserId: String? = null,

        @ApiModelProperty("是否匿名")
        var anonymity: Boolean? = false,

        @ApiModelProperty("上报内容")
        @Column(length = 1000)
        var content: String? = "",

        @ApiModelProperty("上报图片")
        var pics: String? = "",

        @ApiModelProperty("受理人(多选)")
        var checkUserIds: String? = "",

        @ApiModelProperty("实际处理人")
        var actualCheckUserId: String? = null,

        @ApiModelProperty("审核意见")
        var checkAdvice: String? = "",

        @ApiModelProperty("审核时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        var checkTime: Date? = null

) : XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()


    companion object {
        const val serialVersionUID = 1L
    }
}